/*
 * Copyright 2008 Zoundry LLC, Inc.  All Rights Reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 */
package org.zoundry.gaedt.core.models.cspec;

import org.zoundry.gaedt.core.models.IZGaeModelFactory;
import org.zoundry.gaedt.core.models.IZGaeModelMutatorProvider;
import org.zoundry.gaedt.core.models.IZGaeModelTypeMapper;
import org.zoundry.gaedt.core.models.ZGaeSaxModelReader;

/**
 * A reader to read in a controller spec.
 */
public class ZGaeCSpecReader extends ZGaeSaxModelReader
{
    private static final ZGaeCSpecReader sReader = new ZGaeCSpecReader();

    /**
     * Singleton accessor.
     */
    public static ZGaeCSpecReader getInstance()
    {
        return sReader;
    }

    /**
     * Creates the mutator provider.
     */
    private static IZGaeModelMutatorProvider createMutatorProvider()
    {
        return new ZGaeCSpecMutatorProvider();
    }

    /**
     * Creates the type mapper.
     */
    private static IZGaeModelTypeMapper createTypeMapper()
    {
        return new ZGaeCSpecTypeMapper();
    }

    /**
     * Creates the model factory.
     */
    private static IZGaeModelFactory createModelFactory()
    {
        return new ZGaeCSpecModelFactory();
    }

    /**
     * C'tor.
     */
    private ZGaeCSpecReader()
    {
        super(createModelFactory(), createTypeMapper(), createMutatorProvider());
    }
    
}
